home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Broderbund Demo / DemoData / _menu.Dxr / 00006_PrintMgr.ls < prev    next >
Encoding:
Text File  |  1997-09-03  |  893 b   |  45 lines

  1. property printInfo, printType
  2.  
  3. on new me
  4.   set printInfo to [:]
  5.   set printType to [:]
  6.   return me
  7. end
  8.  
  9. on addPrintSection me, section, thePrintType, printMembers
  10.   setaProp(printType, section, thePrintType)
  11.   if listp(printMembers) then
  12.     setaProp(printInfo, section, printMembers)
  13.   else
  14.     set theList to []
  15.     append(theList, printMembers)
  16.     setaProp(printInfo, section, theList)
  17.   end if
  18. end
  19.  
  20. on infoExists me, section
  21.   if voidp(getaProp(printInfo, section)) then
  22.     return 0
  23.   else
  24.     return 1
  25.   end if
  26. end
  27.  
  28. on getPrintType me, section
  29.   return getaProp(printType, section)
  30. end
  31.  
  32. on printInfo me, section
  33.   set doc to new(xtra("Printomatic_Lite"))
  34.   if not objectp(doc) then
  35.     exit
  36.   end if
  37.   setDocumentName(doc, section && "info")
  38.   set theList to getaProp(printInfo, section)
  39.   repeat with m in theList
  40.     append(doc, member m)
  41.   end repeat
  42.   print(doc)
  43.   set doc to 0
  44. end
  45.